﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

/*********************************************************
 * 命名空间 MDT.VirtualSoftPlatform
 * 接口名称 BaseParameter
 * 开发人员：-nhy
 * 创建时间：2022/6/27 14:14:25
 * 描述说明：
 * 更改历史：
 * 
 * *******************************************************/
namespace Simple.Tools
{
    /// <summary>
    /// 
    /// </summary>
    public class BaseParameter
    {
        static BaseParameter()
        {
            MaxPageSize = 1000;
        }
        /// <summary>
        /// 
        /// </summary>
        public BaseParameter()
        {
            PageIndex = 1;
            PageSize = 20;
            IsPage = true;
            SearchItem = string.Empty;
        }
        /// <summary>
        /// 
        /// </summary>
        public int PageIndex { get { return current; } set { current = value; } }
        /// <summary>
        /// 
        /// </summary>
        public int PageSize { get { return pageSize; } set {

                if(value>=MaxPageSize)
                {
                    pageSize = MaxPageSize;
                }
                else
                {
					pageSize = value;
				}
			} }


        /// <summary>
        /// 
        /// </summary>
        public bool IsPage { get { return isPage; } set { isPage = value; } }
        /// <summary>
        /// 
        /// </summary>
        public bool FirstOrDefault { get { return firstOrDefault; } set { firstOrDefault = value; } }
        /// <summary>
        /// 
        /// </summary>
        public string SearchItem { get { return searchItem; } set { searchItem = value; } }


        private int pageSize;
        private bool firstOrDefault;
        private int current;
        private bool isPage;
        private string searchItem;

		#region static field
        /// <summary>
        /// 默认分页最大值
        /// </summary>
		public static int MaxPageSize;
		#endregion

	}
}
